home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-05
/
lanscrpt.zip
/
LOGIN.BAT
< prev
next >
Wrap
DOS Batch File
|
1992-08-18
|
1KB
|
54 lines
:start
@echo off
cls
rem First I start by setting up some enviroment variables that will be used
rem later to figure out which user it is, and what station they are logging
rem in from. Also, I set up a error variable for looping. (Thanks for the
rem idea, Rick!)
set name=xxxxxx
set neterror=xxxxxx
set net_error=xxx
rem This is where the real fun stuff comes in, Using the net user feature, I
rem set up the first string variable: name. The !"user" macro is used to put
rem the users login name into the variable.
net user ?"User:" ^"Password:"
net string name !"user"
net login \\server1
if %net_error%==86 goto start
if %net_error%==0 goto continue
if %net_error%==51 goto no_server
goto panic
:continue
net string neterror !"login=SERVER1"
if %neterror%==TRUE goto net_ok
if %neterror%==FALSE goto start
:net_ok
net use z: \\server1
rem I use z: as the server's control directory, so that I can set up a central
rem place to configure the network. Really makes it easy.
echo Configuring, please wait.
call z:\system
rem z:\system is a batch file that gets run by every workstation on the net.
rem I use it to setup standard drives, and standard printers.
goto end
rem A little error checking here.
:no_server
echo Server1 is not up yet.
echo Don't panic.
goto start
:panic
echo Oops, there's a problem. Evidently, Server1 is not up at all.
echo Please find Ken. Thanks.
goto end
:end
net logout \\server1
pause
login